using System;
using QAssetBundle;
using UnityEngine;
using QFramework;

namespace ProjectSurvival
{
	public partial class Treasure : GamePlayObject
	{
		
		private void OnTriggerEnter2D(Collider2D other)
		{
			if (other.GetComponent<CollectableArea>())
			{
				AudioKit.PlaySound(Treasure_chest_wav.Treasure_chest);
				gameObject.DestroySelfGracefully();
				GamePanel.OnOpenTreasurePanel.Trigger();
			}
		}
		protected override Collider2D Collider => SelfCircleCollider2D;
	}
}
